import request from '@/utils/request'

// 查询工单列表
export function listMoeDet(query) {
  return request({
    url: '/production/moeDet/listPlan',
    method: 'get',
    params: query
  })
}

// 查询工单详细
export function getMoeDet(moeId) {
  return request({
    url: '/production/moeDet/' + moeId,
    method: 'get'
  })
}

// 修改工单
export function updateMoeDet(data) {
  return request({
    url: '/production/moeDet',
    method: 'put',
    data: data
  })
}

// 删除工单
export function delMoeDet(moeId) {
  return request({
    url: '/production/moeDet/' + moeId,
    method: 'delete'
  })
}

//暂停工单
export function stopMoeDet(moeId) {
  return request({
    url: '/production/moeDet/stopMoeDet/' + moeId,
    method: 'put'
  })
}
//移动工单
export function mobileMoeDet(moeIds,moeJtbh) {
  return request({
    url: '/production/moeDet/mobileMoeDet/' + moeIds +'/'+moeJtbh,
    method: 'put'
  })
}
//合并工单
export function mergeMoeDet(moeIds) {
  return request({
    url: '/production/moeDet/mergeMoeDet/' + moeIds,
    method: 'put'
  })
}
//取消合并工单
export function cMergeMoeDet(moeGlids) {
  return request({
    url: '/production/moeDet/cMergeMoeDet/' + moeGlids,
    method: 'put'
  })
}

// 导出工单
export function exportMoeDet(query) {
  return request({
    url: '/production/moeDet/export',
    method: 'get',
    params: query
  })
}

//机台排程资料查询
export function listPlanReport(query) {
  return request({
    url: '/production/moeDet/listPlanReport',
    method: 'get',
    params: query
  })
}
///hd-api/production/moeDet/getMoeJt
// 查询工单列表
export function listMoeDetJt(query) {
  return request({
    url: '/production/moeDet/getMoeJt',
    method: 'get',
    params: query
  })
}
//查询生产计划达成率
export function machineAchiveGet(query) {
  return request({
    url: '/production/moeDet/machineAchiveGet',
    method: 'get',
    params: query
  })
}

// 工单排序
export function orderFinish(data) {
  return request({
    url: '/production/moeDet/orderFinish',
    method: 'put',
    data: data
  })
}


//获取制造工单加工盈亏
export function listMoeProcess(query) {
  return request({
    url: '/money/money_profit/getMoeProcessMoney',
    method: 'get',
    params: query
  })
}
//获取营销订单盈亏
export function listMarketingProfit(query) {
  return request({
    url: '/money/money_profit/getMarketingProfit',
    method: 'get',
    params: query
  })
}


//获取备库订单盈亏
export function listKcMarketingProfit(query) {
  return request({
    url: '/money/money_profit/standbyOrderInformation',
    method: 'get',
    params: query
  })
}

//导出营销报表
export function marketingProfitExport(query) {
  return request({
    url: '/money/money_profit/marketingProfitExport',
    method: 'get',
    params: query
  })
}
//导出制造工单加工盈亏报表
export function moeProcessProfitExport(query) {
  return request({
    url: '/money/money_profit/moeProcessProfitExport',
    method: 'get',
    params: query
  })
}

//导出备库订单盈亏
export function exportStandbyOrderInformation(query) {
  return request({
    url: '/money/money_profit/exportStandbyOrderInformation',
    method: 'get',
    params: query
  })
}


